<?php
namespace Model;

/**
 * 微信服务
 */

class SvrWeixin extends SvrBase
{
	const APP_ID = 'wx33cb94868ec7936e';
	const SECRET_ID = 'd11b45bec6108f40c381b5a3c1a49fff';

    /**
     * 获取access_token
	 *
     */
    public function getVxAccessToken($code){
        $params  = [
            'appid'      => self::APP_ID,
            'secret'      => self::SECRET_ID,
            'code'        => $code,
			'grant_type'  => 'authorization_code'
        ];
        $apiSign = 'https://api.weixin.qq.com/sns/oauth2/access_token';
        $result = $this->get($apiSign, $params, 0);
        return $result;
    }
}